package com.huawei.fakedouyin.danmu;

import android.graphics.Paint;

import java.util.Objects;

/**
 * 绘制的弹幕数据bean
 */
public class TextBean {
    //文字
    private String text;
    //文字大小
    private Boolean size;
    //文字颜色
    private Integer color;
    //文字X轴
    private float x;
    //文字Y轴
    private float y;
    //文字移动速度
    private int speed;
    //画笔
    private Paint paint;

    //弹幕通道等级 共4个通道
    private int level;

    private int highLevel = 0;

    private String tag = "";

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public boolean getSize() {
        return size;
    }

    public void setSize(boolean size) {
        this.size = size;
    }

    public Integer getColor() {
        return color;
    }

    public void setColor(Integer color) {
        this.color = color;
    }

    public float getX() {
        return x;
    }

    public void setX(float x) {
        this.x = x;
    }

    public float getY() {
        return y;
    }

    public void setY(float y) {
        this.y = y;
    }

    public int getSpeed() {
        return speed;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    public Paint getPaint() {
        return paint;
    }

    public void setPaint(Paint paint) {
        this.paint = paint;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public String getTag() {
        return tag;
    }

    public int getHighLevel() {
        return highLevel;
    }

    public void setHighLevel(int highLevel) {
        this.highLevel = highLevel;
    }

    //判断判断两个对象是否相等，对象是否存在，对象的tag是否相等
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TextBean bean = (TextBean) o;
        return Objects.equals(tag, bean.tag);
    }

    //返回对象的tag hash值
    @Override
    public int hashCode() {
        return Objects.hash(tag);
    }
}